<template>
  <div>
    <button @click="isShow = !isShow">显示/隐藏</button>
    <transition name="jojo" appear>
      <h1 v-show="isShow">你好啊！</h1>
    </transition>
  </div>
</template>

<script>
export default {
  name: "MyAnimation",
  data() {
    return {
      isShow: true
    }
  }
}
</script>

<style scoped>
h1{
  background-color: orange;
}

.jojo-enter-active{
  animation: jojo 0.5s linear;
}

.jojo-leave-active{
  animation: jojo 0.5s linear reverse;
}

@keyframes jojo {
  from{
    transform: translateX(-100%);
  }
  to{
    transform: translateX(0px);
  }
}
</style>
